﻿using System;
using System.Collections.Generic;
using System.Linq;
using S7.Net;
using System.Text;
using System.Threading.Tasks;
using ZR.DataCollection.Model;

namespace ZR.DataCollection.ICommunication
{
    public interface INormCommunication : IDisposable
    {
        event Action<int, string, object> plc_dataChange;

        void Connection(string ip, int port, int slot, int rack, CpuType cpuType = CpuType.S71500);

        bool Start();

        bool Close();

        bool ConnectionSubPonit(List<CommPoint> ponits, Dictionary<int, int> keyValues);

        public Task<byte[]> ReadDbBlockAsync(int db, int startByteAdr, int count);

        public void HandInvoke(int itemNo, string address, object value);

        public object ReadAddress(string address);

        object ReadValue(int itemNo);

        object ReadValues(int[] itemsNo);

        object WriteValue(int itemNo, object value);

        object WriteValues(int[] itemsNo, string[] values);

        public object WriteAddress(string address, object value);

        void DisConnection();
    }
}